CXX = g++
CC  = g++

CXXFLAGS = -c -fPIC -Isrc/include/ -g
LDFLAGS  = -L/usr/local/lib/ -ldl -lfst -lfstscript

VPATH = src/lib:src/bin

objs = real-arc.o mmap-fst.o script-wrapper.o fstxcountpaths.o autocomplete.o fstxprintstrings.o

all : real-arc boolean-arc mmap-fst script-wrapper fstxprintstrings maxplus-arc

boolean-arc: boolean-arc.o
	$(CC) $^ $(LDFLAGS) -shared -W1,-soname, -o boolean-arc.so 

real-arc: real-arc.o
	$(CC) $^ $(LDFLAGS) -shared -W1,-soname, -o real-arc.so 

maxplus-arc: maxplus-arc.o
	$(CC) $^ $(LDFLAGS) -shared -W1,-soname, -o maxplus-arc.so 

mmap-fst: mmap-fst.o
	$(CC) $^ $(LDFLAGS) -shared -W1,-soname, -o mmap-fst.so 
	
script-wrapper: script-wrapper.o
	$(CC) $^ $(LDFLAGS) -shared -W1,-soname, -o script-wrapper.so

fstxcountpaths: fstxcountpaths.o
	$(CC) $^ $(LDFLAGS) -o $@ $(LDFLAGS)

fstxprintstrings: fstxprintstrings.o
	$(CC) $^ $(LDFLAGS) -o $@ $(LDFLAGS)

lev-makedic: lev-makedic.o
	$(CC) $^ $(LDFLAGS) -o $@ $(LDFLAGS)

autocomplete: autocomplete.o
	$(CC) $^ $(LDFLAGS) -o $@ $(LDFLAGS)
clean:
	rm -f *.o *.so	
